{block name="title" prepend}{if $mode == "defense"}{$LNG.lm_defenses}{else}{$LNG.lm_shipshard}{/if}{/block}
{block name="content"}
{if !$NotBuilding}<table width="70%" id="infobox" style="border: 2px solid red; text-align:center;background:transparent"><tr><td>{$LNG.bd_building_shipyard}</td></tr></table><br><br>{/if}
{if !empty($BuildList)}
<table style="width:760px">
	<tr>
		<td class="transparent">
			<div id="bx" class="z"></div>
			<br>
			<form action="game.php?page=shipyard&amp;mode={$mode}" method="post">
			<input type="hidden" name="action" value="delete">
			<table>
			<tr>
				<th>&nbsp;</th>
			</tr>
			<tr>
				<td><select name="auftr[]" id="auftr" size="10" multiple><option>&nbsp;</option></select><br><br>{$LNG.bd_cancel_warning}<br><input type="submit" value="{$LNG.bd_cancel_send}"></td>
			</tr>
			<tr>
				<th>&nbsp;</th>
			</tr>
			</table>
			</form>
			<br><span id="timeleft"></span><br><br>
		</td>
	</tr>
</table>
<br>
{/if}
<form action="game.php?page=shipyard&amp;mode={$mode}" method="post">
<table style="width:760px">
	{foreach $elementList as $ID => $Element}
	<tr>
		<td rowspan="2" style="width:120px;">
			<a href="#" onclick="return Dialog.info({$ID})">
				<img src="{$dpath}gebaeude/{$ID}.gif" alt="{$LNG.tech.{$ID}}" width="120" height="120">
			</a>
		</td>
		<th>
			<a href="#" onclick="return Dialog.info({$ID})">{$LNG.tech.{$ID}}</a><span id="val_{$ID}">{if $Element.available != 0} ({$LNG.bd_available} {$Element.available|number}){/if}</span>
		</th>
	</tr>
	<tr style="padding:0;">
		<td style="padding:0;">
        <div style="position:relative; padding:0; height:100px;">
			<div style=" width:75%; padding-left:5px; padding-top:10px; float:left; text-align:left;">{$LNG.shortDescription.{$ID}}
            </div>
            <div style="max-width:20%; min-width:15%; float:right; text-align:center; padding-top:20px; padding-right:10px;">
                    {if $Element.AlreadyBuild}<span style="color:red">{$LNG.bd_protection_shield_only_one}</span>{elseif $NotBuilding && $Element.buyable}<input type="text" name="fmenge[{$ID}]" id="input_{$ID}" size="{$maxlength}" maxlength="{$maxlength}" value="0" tabindex="{$smarty.foreach.FleetList.iteration}"><br />
					<input type="button" value="{$LNG.bd_max_ships}" onclick="$('#input_{$ID}').val('{$Element.maxBuildable}')">
                    {/if}
                    </div>
           	
				<div style="position:absolute;padding-right:20px; padding-left:10px; left:0; bottom:0; border-top-right-radius:20px; line-height:20px; border-top:#666666 solid 2px;">
                        {foreach $Element.costRessources as $RessID => $RessAmount}
                        {$LNG.tech.{$RessID}}: <b><span style="color:{if $Element.costOverflow[$RessID] == 0}lime{else}red{/if}">{$RessAmount|number}</span></b>
                        {/foreach}
                    </div>	
                    <div style="padding-right:5px; padding-left:15px; position:absolute; right:0; bottom:0;  border-top:2px solid #666666; border-top-left-radius:20px; line-height:20px; color:#FFCC00;">
						{$Element.elementTime|time}
					</div>
			</div>
		</td>
	</tr>
	<tr>
		<td colspan="2" style="margin-bottom:10px;">  
			<table style="width:100%">
				<tr>
					<td class="transparent left">
                    	{if $Element.maxBuildable > 0}
                    		{$LNG.bd_max_ships_long}: <span style="font-weight:700">{$Element.maxBuildable|number}</span>
                        {else}
                            {$LNG.bd_remaining}
                            {foreach $Element.costOverflow as $ResType => $ResCount}
                            {$LNG.tech.{$ResType}}: <span style="font-weight:700">{$ResCount|number}</span>
                            {/foreach}
                        {/if}
					</td>
				</tr>
			</table>
		</td>
	</tr>
	{/foreach}
	{if $NotBuilding}<tr><th colspan="2" style="text-align:center"><input type="submit" value="{$LNG.bd_build_ships}"></th></tr>{/if}
    <tr>
    	<td class="transparent" style="text-align:left" colspan="3">
        	<a href="game.php?page=shipyard&amp;mode=inter">Компактный вид</a> <br /> Мгновенная покупка за Темную материю <a href="game.php?page=dmfleet">[Флота]</a> - <a href="game.php?page=dmdeff">[Обороны]</a>
        </td>
    </tr>
</table>
</form>
<script type="text/javascript">
data			= {$BuildList|json};
bd_operating	= '{$LNG.bd_operating}';
bd_available	= '{$LNG.bd_available}';
</script>
{/block}